package com.xiaoy.core.base.menu.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.xiaoy.core.base.security.role.entity.Role;
import com.xiaoy.core.base.util.store.config.ConfigTable;
import com.xiaoy.entity.BaseBean;
@Entity
@Table(name=ConfigTable.Menu.BUTTON_ROLE_TABLENAME)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ButtonRole extends BaseBean{

	
	private Button button;
	private Role role;
	private String info;
	
	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) 
	@JoinColumn(name="button_id")
	public Button getButton() {
		return button;
	}

	public void setButton(Button button) {
		this.button = button;
	}

	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) 
	@JoinColumn(name="role_id")
	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public String getInfo() {
		return info;
	}

	public void setInfo(String info) {
		this.info = info;
	}
	
}
